﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
	mc:Ignorable="d"
	x:Class="ImageView.MiniKep"
	x:Name="Container"
	d:DesignWidth="640" d:DesignHeight="480" Width="200" HorizontalAlignment="Right" Height="250" MouseDoubleClick="Container_MouseDown">
	<UserControl.Resources>
		<Storyboard x:Key="MouseOver">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="RectKep">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1.1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="RectKep">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1.1"/>
			</DoubleAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="TbLeiras">
				<EasingColorKeyFrame KeyTime="0" Value="Black"/>
				<EasingColorKeyFrame KeyTime="0:0:0.2" Value="#FF1919B2"/>
			</ColorAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="MouseOut">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="RectKep">
				<SplineDoubleKeyFrame KeyTime="0" Value="1.1"/>
				<SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="RectKep">
				<SplineDoubleKeyFrame KeyTime="0" Value="1.1"/>
				<SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="TbLeiras">
				<SplineColorKeyFrame KeyTime="0" Value="#FF1919B2"/>
				<SplineColorKeyFrame KeyTime="0:0:0.2" Value="Black"/>
			</ColorAnimationUsingKeyFrames>
		</Storyboard>
	</UserControl.Resources>
	<UserControl.Triggers>
		<EventTrigger RoutedEvent="Mouse.MouseEnter">
			<BeginStoryboard Storyboard="{StaticResource MouseOver}"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="Mouse.MouseLeave">
			<BeginStoryboard x:Name="MouseOut_BeginStoryboard" Storyboard="{StaticResource MouseOut}"/>
		</EventTrigger>
	</UserControl.Triggers>
	<UserControl.Background>
		<ImageBrush/>
	</UserControl.Background>

	<Grid x:Name="LayoutRoot">
		<Grid.RowDefinitions>
			<RowDefinition/>
			<RowDefinition Height="50"/>
		</Grid.RowDefinitions>
        <Rectangle x:Name="RectKep" Height="170" Grid.Row="0" Width="170" RenderTransformOrigin="0.5,0.5">
			<Rectangle.Fill>
                <ImageBrush ImageSource="{Binding Image, ElementName=Container}" Stretch="Uniform"/>
			</Rectangle.Fill>
			<Rectangle.RenderTransform>
				<TransformGroup>
					<ScaleTransform x:Name="ImgScale" ScaleX="1" ScaleY="1"/>
					<SkewTransform/>
					<RotateTransform x:Name="ImgRot" Angle="0"/>
					<TranslateTransform/>
				</TransformGroup>
			</Rectangle.RenderTransform>
		</Rectangle>
        <Rectangle x:Name="VideoIcon" Width="60" Height="60" Visibility="Hidden" VerticalAlignment="Bottom" HorizontalAlignment="Right">
            <Rectangle.Fill>
                <ImageBrush ImageSource="../images/player_play.png"/>
            </Rectangle.Fill>
        </Rectangle>
        <TextBlock x:Name="TbLeiras" Margin="0" Grid.Row="1" TextWrapping="Wrap" Text="{Binding ImageText, ElementName=Container}" TextAlignment="Center" FontWeight="Bold" FontSize="12" TextDecorations="Underline"/>
	</Grid>
</UserControl>